/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.PurchaseState;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: PurchaseOrder <br/>
 * Function: 采购订单 <br/>
 * date: 2018-11-08 14:00:02 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="purchase_orders")
public class PurchaseOrder extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 单号 
    @Column(name="no", length = 300)
	private String no = null;

	// 供应商 
    @Column(name="supplier_id")
	private Long supplierId = null;

	// 供应商名称
    @Column(name="supplier_name")
	private String supplierName = null;

	// 仓库id 
    @Column(name="warehouse_id")
	private Long warehouseId = null;
	// 仓库名称
    @Column(name="warehouse_name")
	private String warehouseName = null;

	// 收货地址 
    @Column(name="address", length = 300)
	private String address = null;

	// 订单金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 采购人 
    @Column(name="purchaser")
	private Long purchaser = null;
	// 采购人 名称
    @Column(name="purchaser_name")
	private String purchaserName = null;

	// 采购日期 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="purchase_time")
	private Date purchaseTime = null;

	// 审核人 
    @Column(name="checker")
	private Long checker = null;

	// 审核人
    @Column(name="checker_name")
	private String checkerName = null;

	// 审核日期 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="check_time")
	private Date checkTime = null;

	// 发货时间 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="send_time")
	private Date sendTime = null;

	// 收货日期 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="accept_time")
	private Date acceptTime = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private PurchaseState state = null;


	// 菜品库
	@Column(name="store_id", length = 300)
	private Long storeId = null;

	// 菜品库
	@Column(name="store_name", length = 300)
	private String storeName = null;

    @Tolerate
	public PurchaseOrder() {
		
	}
    @Tolerate
	public PurchaseOrder(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取单号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置单号
     */
	public PurchaseOrder setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取供应商
	 */
	public Long getSupplierId() {
		return this.supplierId;
	}

    /**
     * 设置供应商
     */
	public PurchaseOrder setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
		return this;
	}

	/**
	 * 获取仓库id
	 */
	public Long getWarehouseId() {
		return this.warehouseId;
	}

    /**
     * 设置仓库id
     */
	public PurchaseOrder setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
		return this;
	}

	/**
	 * 获取收货地址
	 */
	public String getAddress() {
		return this.address;
	}

    /**
     * 设置收货地址
     */
	public PurchaseOrder setAddress(String address) {
		this.address = address;
		return this;
	}

	/**
	 * 获取订单金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置订单金额
     */
	public PurchaseOrder setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	/**
	 * 获取采购人
	 */
	public Long getPurchaser() {
		return this.purchaser;
	}

    /**
     * 设置采购人
     */
	public PurchaseOrder setPurchaser(Long purchaser) {
		this.purchaser = purchaser;
		return this;
	}

	/**
	 * 获取采购日期
	 */
	public Date getPurchaseTime() {
		return this.purchaseTime;
	}

    /**
     * 设置采购日期
     */
	public PurchaseOrder setPurchaseTime(Date purchaseTime) {
		this.purchaseTime = purchaseTime;
		return this;
	}

	/**
	 * 获取审核人
	 */
	public Long getChecker() {
		return this.checker;
	}

    /**
     * 设置审核人
     */
	public PurchaseOrder setChecker(Long checker) {
		this.checker = checker;
		return this;
	}

	/**
	 * 获取审核日期
	 */
	public Date getCheckTime() {
		return this.checkTime;
	}

    /**
     * 设置审核日期
     */
	public PurchaseOrder setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
		return this;
	}

	/**
	 * 获取发货时间
	 */
	public Date getSendTime() {
		return this.sendTime;
	}

    /**
     * 设置发货时间
     */
	public PurchaseOrder setSendTime(Date sendTime) {
		this.sendTime = sendTime;
		return this;
	}

	/**
	 * 获取收货日期
	 */
	public Date getAcceptTime() {
		return this.acceptTime;
	}

    /**
     * 设置收货日期
     */
	public PurchaseOrder setAcceptTime(Date acceptTime) {
		this.acceptTime = acceptTime;
		return this;
	}

	public PurchaseState getState() {
		return state;
	}

	public void setState(PurchaseState state) {
		this.state = state;
	}

	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}

	public String getPurchaserName() {
		return purchaserName;
	}

	public void setPurchaserName(String purchaserName) {
		this.purchaserName = purchaserName;
	}

	public String getCheckerName() {
		return checkerName;
	}

	public void setCheckerName(String checkerName) {
		this.checkerName = checkerName;
	}

	public Long getStoreId() {
		return storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}
}
